﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class Admins_MemManage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
      
    }
    protected void LinkButton1_Click(object sender, EventArgs e)   //显示全部会员名单
    {
        Members member = new Members();
        GridView1.DataSource = member.GetAllMembers();
        GridView1.DataBind();
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }

    protected void LinkButton2_Click(object sender, EventArgs e)    //删除会员
    {
        Members member = new Members();

        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1");
            if (cb.Checked)
            {
                int str;
                str = Convert.ToInt32(GridView1.Rows[i].Cells[0].Text);  //获取此项ID

                member.removeMem(str);   //删除对应项
            }
        }
        GridView1.DataSource = member.GetAllMembers();
        GridView1.DataBind();
    }

    protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)
    {

    }

}
    